package com.googlecode.kipler.satisfiability.clash;

import java.util.Set;

import com.googlecode.kipler.container.dl.ABox;
import com.googlecode.kipler.container.dl.DependencySet;
import com.googlecode.kipler.syntax.formula.Formula;

/**
 * 
 * @author İnanç Seylan
 * 
 */
public class SHOIQClashDetectionStrategy implements ClashDetectionStrategy {

	private String explanation;

	private ALCQClashDetectionStrategy alcqStrategy = new ALCQClashDetectionStrategy();

	private NominalClashDetectionStrategy nominalStrategy = new NominalClashDetectionStrategy();

	private DependencySet dependencySet;

	public boolean hasClash(ABox abox, Formula formula) {
		boolean result = false;
		if (alcqStrategy.hasClash(abox, formula)) {
			result = true;
			explanation = alcqStrategy.getExplanation();
			dependencySet = alcqStrategy.getDependencySet();
		} else if (nominalStrategy.hasClash(abox, formula)) {
			result = true;
			explanation = nominalStrategy.getExplanation();
			dependencySet = nominalStrategy.getDependencySet();
		}
		return result;
	}

	public DependencySet getDependencySet() {
		return dependencySet;
	}

	public String getExplanation() {
		return explanation;
	}

	@Override
	public Set<Formula> getClashCause() {
		// TODO Auto-generated method stub
		return null;
	}

}
